﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NHibernate.Validator.Constraints;
using Landscape.Business.Validators;

namespace Landscape.Business.Entities
{
    public class Action
    {
        public Action()
        {
            this.ID = Guid.Empty;
            this.Responses = new List<ActionResponse>();
            this.Attachments = new List<FileAttachment>();
            this.Status = ActionStatus.NEW;
            this.IsDeleted = false;
            this.CreatedDate = DateTime.Now;
            this.UpdatedDate = DateTime.Now;
            this.Reviewers = new List<UserMaster>();
        }

        public virtual Guid ID
        { get; set; }

        public virtual string Code
        { get; set; }

        [NotNull]
        [Length(Max=255, Min=5, Message="Action track item title should have 5 - 255 charectors.")]
        public virtual string Title
        { get; set; }

        [Length(Max = 2000, Message = "Action track item description should have maximum 2000 charectors.")]
        public virtual string Description
        { get; set; }

        [Length(Max = 2000, Message = "Action track NC description should have maximum 2000 charectors.")]
        public virtual string NonConforDescription
        { get; set; }

        public virtual Vessel Vessel
        { get; set; }

        public virtual Department Department
        { get; set; }

        public virtual UserMaster Responder
        { get; set; }

        public virtual IList<UserMaster> Reviewers
        { get; set; }

        public virtual bool NeedHseqApproval
        { get; set; }

        public virtual bool NeedOpsDirectorApproval
        { get; set; }

        public virtual DateTime? ResponseDueDate
        { get; set; }

        public virtual ActionPriority Priority
        { get; set; }

        public virtual ActionType ActionType
        { get; set; }

        public virtual ActionSource Source
        { get; set; }

        public virtual IList<ActionResponse> Responses
        { get; set; }

        public virtual IList<FileAttachment> Attachments
        { get; set; }

        public virtual ActionStatus Status
        { get; set; }

        public virtual bool IsReleased
        { get; set; }

        public virtual DateTime? ReleasedDate
        { get;set; }

        public virtual Guid ReleasedBy
        { get; set; }

        public virtual bool IsDeleted
        { get; set; }

        public virtual Guid CreatedBy
        { get; set; }

        public virtual DateTime CreatedDate
        { get; set; }

        public virtual Guid UpdatedBy
        { get; set; }

        public virtual DateTime UpdatedDate
        { get; set; }

        public virtual string WfCode
        { get; set; }
    }
}
